package com.mifengkong.cygtools.jjcard;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * Created by WANG on 17/12/27.
 */

public class CardMainBean implements Parcelable {

    /**
     * card_list : [{"bill_id":2,"card_id":3,"bank_name":"招商银行","card_no":"2423","user_name":"***","overdue_time":9,"bill_status":"立即还款","remain_limit":"1200.00","grace_period":35,"bill_money":"未出账","bill_status_code":2,"min_payment":"0.00","bank_short":"CMB","bill_date":"2017-12-1","repay_date":"2017-12-20","overdue":{"day":9,"text":"天可能已逾期"}},{"bill_id":3,"card_id":4,"bank_name":"浦发银行","card_no":"3454","user_name":"*顺祺","overdue_time":-14,"bill_status":"已还清","remain_limit":"1234.00","grace_period":35,"bill_money":"未出账","bill_status_code":3,"min_payment":"0.00","bank_short":"SPDB","bill_date":"2017-12-25","repay_date":"2018-01-13","overdue":{"day":27,"text":"天后出账"}},{"bill_id":4,"card_id":6,"bank_name":"浦发银行","card_no":"9585","user_name":"*顺祺","overdue_time":-11,"bill_status":"更新账单","remain_limit":"1234.00","grace_period":35,"bill_money":"待更新","bill_status_code":4,"min_payment":"1.00","bank_short":"SPDB","bill_date":"2017-12-21","repay_date":"2018-01-10","overdue":{"day":11,"text":"天后到期"}},{"bill_id":5,"card_id":7,"bank_name":"浦发银行","card_no":"9586","user_name":"*顺祺","overdue_time":5,"bill_status":"已还清","remain_limit":"1234.00","grace_period":35,"bill_money":"10.00","bill_status_code":0,"min_payment":"1.00","bank_short":"SPDB","bill_date":"2017-12-5","repay_date":"2017-12-24","overdue":{"day":5,"text":"天后到期"}},{"bill_id":8,"card_id":16,"bank_name":"招商银行","card_no":"0474","user_name":"*健","overdue_time":-6,"bill_status":"已还清","remain_limit":"2380414.00","grace_period":49,"bill_money":"119586.00","bill_status_code":0,"min_payment":"100458.00","bank_short":"CMB","bill_date":"2017-12-17","repay_date":"2018-01-05","overdue":{"day":6,"text":"天后到期"}},{"bill_id":20,"card_id":17,"bank_name":"招商银行","card_no":"4668","user_name":"*健","overdue_time":-6,"bill_status":"已还清","remain_limit":"2380414.00","grace_period":49,"bill_money":"119586.00","bill_status_code":0,"min_payment":"100458.00","bank_short":"CMB","bill_date":"2017-12-17","repay_date":"2018-01-05","overdue":{"day":6,"text":"天后到期"}}]
     * summary_info : {"total_card_limit":5005402,"total_remain_limit":4765730}
     */

    private SummaryInfoBean summary_info;
    private List<CardListBean> card_list;

    public SummaryInfoBean getSummary_info() {
        return summary_info;
    }

    public void setSummary_info(SummaryInfoBean summary_info) {
        this.summary_info = summary_info;
    }

    public List<CardListBean> getCard_list() {
        return card_list;
    }

    public void setCard_list(List<CardListBean> card_list) {
        this.card_list = card_list;
    }

    public static class SummaryInfoBean implements Parcelable {
        /**
         * total_card_limit : 5005402
         * total_remain_limit : 4765730
         */

        private String total_card_limit;
        private String total_remain_limit;
        private String total_used_limit;


        public String getTotal_used_limit() {
            return total_used_limit;
        }

        public void setTotal_used_limit(String total_used_limit) {
            this.total_used_limit = total_used_limit;
        }

        public String getTotal_card_limit() {
            return total_card_limit;
        }

        public void setTotal_card_limit(String total_card_limit) {
            this.total_card_limit = total_card_limit;
        }

        public String getTotal_remain_limit() {
            return total_remain_limit;
        }

        public void setTotal_remain_limit(String total_remain_limit) {
            this.total_remain_limit = total_remain_limit;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.total_card_limit);
            dest.writeString(this.total_remain_limit);
        }

        public SummaryInfoBean() {
        }

        protected SummaryInfoBean(Parcel in) {
            this.total_card_limit = in.readString();
            this.total_remain_limit = in.readString();
        }

        public static final Creator<SummaryInfoBean> CREATOR = new Creator<SummaryInfoBean>() {
            @Override
            public SummaryInfoBean createFromParcel(Parcel source) {
                return new SummaryInfoBean(source);
            }

            @Override
            public SummaryInfoBean[] newArray(int size) {
                return new SummaryInfoBean[size];
            }
        };
    }

    public static class CardListBean implements Parcelable {
        /**
         * bill_id : 2
         * card_id : 3
         * bank_name : 招商银行
         * card_no : 2423
         * user_name : ***
         * overdue_time : 9
         * bill_status : 立即还款
         * remain_limit : 1200.00
         * grace_period : 35
         * bill_money : 未出账
         * bill_status_code : 2
         * min_payment : 0.00
         * bank_short : CMB
         * bill_date : 2017-12-1
         * repay_date : 2017-12-20
         * overdue : {"day":9,"text":"天可能已逾期"}
         */


        private int bill_id;
        private int card_id;
        private String bank_name;
        private String card_no;
        private String user_name;
        private String overdue_time;
        private String bill_status;
        private String remain_limit;
        private String grace_period;
        private String bill_money;
        private String bill_status_code;
        private String min_payment;
        private String bank_short;
        private String bill_date;
        private String repay_date;
        private OverdueBean overdue;
        //标记每个item是否有阴影的头部
        private boolean havaShadow = false;
        private int marginBottom = -1;
        private float scale ;  //传进度
        private boolean supportSlideSlip = true; //当前Item是否支持侧滑
        private boolean slideSlipIsOpen = false; //当前IT恩是否是侧滑打开的状态
        private boolean isHide = false;//是否需要隐藏
        private boolean isCanDelete;//是否已经显示了长按删除的按钮
        private String refreshStatus ="0";
        private String present = "";

        public String getPresent() {
            return present;
        }

        public void setPresent(String present) {
            this.present = present;
        }

        public String getRefreshStatus() {
            return refreshStatus;
        }

        public void setRefreshStatus(String refreshStatus) {
            this.refreshStatus = refreshStatus;
        }

        public boolean isCanDelete() {
            return isCanDelete;
        }

        public void setCanDelete(boolean canDelete) {
            isCanDelete = canDelete;
        }

        public boolean isHide() {
            return isHide;
        }

        public void setHide(boolean hide) {
            isHide = hide;
        }

        public boolean isSlideSlipIsOpen() {
            return slideSlipIsOpen;
        }

        public void setSlideSlipIsOpen(boolean slideSlipIsOpen) {
            this.slideSlipIsOpen = slideSlipIsOpen;
        }

        public boolean isSupportSlideSlip() {
            return supportSlideSlip;
        }

        public void setSupportSlideSlip(boolean supportSlideSlip) {
            this.supportSlideSlip = supportSlideSlip;
        }

        public float getScale() {
            return scale;
        }

        public void setScale(float scale) {
            this.scale = scale;
        }

        public int getMarginBottom() {
            return marginBottom;
        }

        public void setMarginBottom(int marginBottom) {
            this.marginBottom = marginBottom;
        }

        public boolean isHavaShadow() {
            return havaShadow;
        }

        public void setHavaShadow(boolean havaShadow) {
            this.havaShadow = havaShadow;
        }

        public int getBill_id() {
            return bill_id;
        }

        public void setBill_id(int bill_id) {
            this.bill_id = bill_id;
        }

        public int getCard_id() {
            return card_id;
        }

        public void setCard_id(int card_id) {
            this.card_id = card_id;
        }

        public String getBank_name() {
            return bank_name;
        }

        public void setBank_name(String bank_name) {
            this.bank_name = bank_name;
        }

        public String getCard_no() {
            return card_no;
        }

        public void setCard_no(String card_no) {
            this.card_no = card_no;
        }

        public String getUser_name() {
            return user_name;
        }

        public void setUser_name(String user_name) {
            this.user_name = user_name;
        }

        public String getOverdue_time() {
            return overdue_time;
        }

        public void setOverdue_time(String overdue_time) {
            this.overdue_time = overdue_time;
        }

        public String getBill_status() {
            return bill_status;
        }

        public void setBill_status(String bill_status) {
            this.bill_status = bill_status;
        }

        public String getRemain_limit() {
            return remain_limit;
        }

        public void setRemain_limit(String remain_limit) {
            this.remain_limit = remain_limit;
        }

        public String getGrace_period() {
            return grace_period;
        }

        public void setGrace_period(String grace_period) {
            this.grace_period = grace_period;
        }

        public String getBill_money() {
            return bill_money;
        }

        public void setBill_money(String bill_money) {
            this.bill_money = bill_money;
        }

        public String getBill_status_code() {
            return bill_status_code;
        }

        public void setBill_status_code(String bill_status_code) {
            this.bill_status_code = bill_status_code;
        }

        public String getMin_payment() {
            return min_payment;
        }

        public void setMin_payment(String min_payment) {
            this.min_payment = min_payment;
        }

        public String getBank_short() {
            return bank_short;
        }

        public void setBank_short(String bank_short) {
            this.bank_short = bank_short;
        }

        public String getBill_date() {
            return bill_date;
        }

        public void setBill_date(String bill_date) {
            this.bill_date = bill_date;
        }

        public String getRepay_date() {
            return repay_date;
        }

        public void setRepay_date(String repay_date) {
            this.repay_date = repay_date;
        }

        public OverdueBean getOverdue() {
            return overdue;
        }

        public void setOverdue(OverdueBean overdue) {
            this.overdue = overdue;
        }

        public static class OverdueBean implements Parcelable {
            /**
             * day : 9
             * text : 天可能已逾期
             */

            private String day;
            private String text;

            public String getDay() {
                return day;
            }

            public void setDay(String day) {
                this.day = day;
            }

            public String getText() {
                return text;
            }

            public void setText(String text) {
                this.text = text;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.day);
                dest.writeString(this.text);
            }

            public OverdueBean() {
            }

            protected OverdueBean(Parcel in) {
                this.day = in.readString();
                this.text = in.readString();
            }

            public static final Creator<OverdueBean> CREATOR = new Creator<OverdueBean>() {
                @Override
                public OverdueBean createFromParcel(Parcel source) {
                    return new OverdueBean(source);
                }

                @Override
                public OverdueBean[] newArray(int size) {
                    return new OverdueBean[size];
                }
            };
        }

        public CardListBean() {
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.bill_id);
            dest.writeInt(this.card_id);
            dest.writeString(this.bank_name);
            dest.writeString(this.card_no);
            dest.writeString(this.user_name);
            dest.writeString(this.overdue_time);
            dest.writeString(this.bill_status);
            dest.writeString(this.remain_limit);
            dest.writeString(this.grace_period);
            dest.writeString(this.bill_money);
            dest.writeString(this.bill_status_code);
            dest.writeString(this.min_payment);
            dest.writeString(this.bank_short);
            dest.writeString(this.bill_date);
            dest.writeString(this.repay_date);
            dest.writeParcelable(this.overdue, flags);
            dest.writeByte(this.havaShadow ? (byte) 1 : (byte) 0);
            dest.writeInt(this.marginBottom);
            dest.writeFloat(this.scale);
            dest.writeByte(this.supportSlideSlip ? (byte) 1 : (byte) 0);
            dest.writeByte(this.slideSlipIsOpen ? (byte) 1 : (byte) 0);
            dest.writeByte(this.isHide ? (byte) 1 : (byte) 0);
            dest.writeByte(this.isCanDelete ? (byte) 1 : (byte) 0);
            dest.writeString(this.refreshStatus);
            dest.writeString(this.present);
        }

        protected CardListBean(Parcel in) {
            this.bill_id = in.readInt();
            this.card_id = in.readInt();
            this.bank_name = in.readString();
            this.card_no = in.readString();
            this.user_name = in.readString();
            this.overdue_time = in.readString();
            this.bill_status = in.readString();
            this.remain_limit = in.readString();
            this.grace_period = in.readString();
            this.bill_money = in.readString();
            this.bill_status_code = in.readString();
            this.min_payment = in.readString();
            this.bank_short = in.readString();
            this.bill_date = in.readString();
            this.repay_date = in.readString();
            this.overdue = in.readParcelable(OverdueBean.class.getClassLoader());
            this.havaShadow = in.readByte() != 0;
            this.marginBottom = in.readInt();
            this.scale = in.readFloat();
            this.supportSlideSlip = in.readByte() != 0;
            this.slideSlipIsOpen = in.readByte() != 0;
            this.isHide = in.readByte() != 0;
            this.isCanDelete = in.readByte() != 0;
            this.refreshStatus = in.readString();
            this.present = in.readString();
        }

        public static final Creator<CardListBean> CREATOR = new Creator<CardListBean>() {
            @Override
            public CardListBean createFromParcel(Parcel source) {
                return new CardListBean(source);
            }

            @Override
            public CardListBean[] newArray(int size) {
                return new CardListBean[size];
            }
        };
    }

    public CardMainBean(List<CardListBean> card_list) {
        this.card_list = card_list;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.summary_info, flags);
        dest.writeTypedList(this.card_list);
    }

    public CardMainBean() {
    }

    protected CardMainBean(Parcel in) {
        this.summary_info = in.readParcelable(SummaryInfoBean.class.getClassLoader());
        this.card_list = in.createTypedArrayList(CardListBean.CREATOR);
    }

    public static final Parcelable.Creator<CardMainBean> CREATOR = new Parcelable.Creator<CardMainBean>() {
        @Override
        public CardMainBean createFromParcel(Parcel source) {
            return new CardMainBean(source);
        }

        @Override
        public CardMainBean[] newArray(int size) {
            return new CardMainBean[size];
        }
    };
}
